package com.metacube.questionbank.service;

import java.util.List;

import com.metacube.questionbank.model.Answer;
import com.metacube.questionbank.model.Question;

/*
 * @author Team Neeraj Jain
 * */
public interface AnswerService {

	/*
	 * @param qId id of question This method returns the answers of the question
	 * whose id id is passed in the argument.
	 * 
	 * @return list of answers or null;
	 */
	public List<Answer> getAnswers(int qId);

	/*
	 * @param userId id of user This method returns the answers which are given
	 * by a particular user.
	 * 
	 * @return list of answers or null
	 */
	public List<Answer> getAnswersByUserId(int userId);

	/*
	 * @param userId id of user This method returns the answers which are liked
	 * by a particular user.
	 * 
	 * @return list of answers or null
	 */
	public List<Answer> getAnswerLikedByUser(int userId);

	/*
	 * @param answer object of answer class This method adds an answer in the
	 * database.
	 */
	public void insertAnswer(Answer answer);

	/*
	 * @param questions list of questions This method returns the list of answer
	 * count.That is,it finds answer count for each question in the list.
	 * 
	 * @return list of answer count
	 */
	public List<Integer> getAnswerCount(List<Question> questions);
	/*
	 * @param questions list of questions This method returns the list of answer
	 * count.That is,it finds answer count for each question in the list.
	 * 
	 * @return list of answer count
	 */
	public Integer getAnswerCount(Question question);
	/*
	 * @param answerId id of answer
	 * This method returns the id of user who posted the answer
	 * @return userId id of user who posted the answer
	 * */
	public Integer getUserIdByAId(int answerId);
}
